package etcdclient

import (
	"go.etcd.io/etcd/clientv3"
	"strings"
	"time"
)

func EtcdInit(etcdAddr string) (*clientv3.Client, error) {
	cli, err := clientv3.New(clientv3.Config{
		Endpoints:   strings.Split(etcdAddr, ","),
		DialTimeout: time.Second * 15,
	})
	if err != nil {
		return nil, err
	}

	return cli, nil
}
